Skip to content

Conversation

@MartijnLaarhoven
Copy link
Owner

Adding the option to reject half of the FT0 detectors to eta dependent studies

Copilot AI review requested due to automatic review settings February 11, 2026 17:00
@github-actions github-actions bot added the pwgcf label Feb 11, 2026
@github-actions github-actions bot changed the title Adding the option to reject half the FT0 [PWGCF] Adding the option to reject half the FT0 Feb 11, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds configuration switches to selectively exclude (reject) FT0A/FT0C inner- and outer-ring channels when building TPC–FT0 correlations, enabling eta-dependent studies with partial FT0 acceptance.

Changes:

  • Added new configurables to reject FT0A/FT0C inner/outer ring channels.
  • Introduced FT0 channel range constants (inner/outer, A/C) to support the rejection logic.
  • Applied the rejection during the FT0 channel loop in fillCorrelationsTPCFT0().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 628 to +639
int chanelid = 0;
float ampl = 0.;
getChannel(ft0, iCh, chanelid, ampl, corType);
if (corType == kFT0C) {
if ((cfgRejectFT0CInside && (chanelid >= kFT0CInnerRingMin && chanelid <= kFT0CInnerRingMax)) || (cfgRejectFT0COutside && (chanelid >= kFT0COuterRingMin && chanelid <= kFT0COuterRingMax))) {
continue;
}
} else if (corType == kFT0A) {
if ((cfgRejectFT0AInside && (chanelid >= kFT0AInnerRingMin && chanelid <= kFT0AInnerRingMax)) || (cfgRejectFT0AOutside && (chanelid >= kFT0AOuterRingMin && chanelid <= kFT0AOuterRingMax))) {
continue;
}
}
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When rejection is enabled, the code still calls getChannel() (which fills FT0Amp/FT0AmpCorrect and applies gain correction) before checking whether the channel will be rejected. This adds avoidable work inside the track×channel nested loop and also means the FT0Amp QA histograms still include channels that are “rejected”. Consider checking the channel id/range before calling getChannel(), or moving the rejection logic into getChannel() so rejected channels are skipped/zeroed consistently and without extra fills.

Suggested change
int chanelid = 0;
float ampl = 0.;
getChannel(ft0, iCh, chanelid, ampl, corType);
if (corType == kFT0C) {
if ((cfgRejectFT0CInside && (chanelid >= kFT0CInnerRingMin && chanelid <= kFT0CInnerRingMax)) || (cfgRejectFT0COutside && (chanelid >= kFT0COuterRingMin && chanelid <= kFT0COuterRingMax))) {
continue;
}
} else if (corType == kFT0A) {
if ((cfgRejectFT0AInside && (chanelid >= kFT0AInnerRingMin && chanelid <= kFT0AInnerRingMax)) || (cfgRejectFT0AOutside && (chanelid >= kFT0AOuterRingMin && chanelid <= kFT0AOuterRingMax))) {
continue;
}
}
// Use preliminary channel id derived from index to perform rejection
int chanelid = static_cast<int>(iCh);
if (corType == kFT0C) {
if ((cfgRejectFT0CInside && (chanelid >= kFT0CInnerRingMin && chanelid <= kFT0CInnerRingMax)) ||
(cfgRejectFT0COutside && (chanelid >= kFT0COuterRingMin && chanelid <= kFT0COuterRingMax))) {
continue;
}
} else if (corType == kFT0A) {
if ((cfgRejectFT0AInside && (chanelid >= kFT0AInnerRingMin && chanelid <= kFT0AInnerRingMax)) ||
(cfgRejectFT0AOutside && (chanelid >= kFT0AOuterRingMin && chanelid <= kFT0AOuterRingMax))) {
continue;
}
}
float ampl = 0.;
// Only retrieve channel information (and trigger its QA) for non-rejected channels
getChannel(ft0, iCh, chanelid, ampl, corType);

Copilot uses AI. Check for mistakes.
Comment on lines 628 to +632
int chanelid = 0;
float ampl = 0.;
getChannel(ft0, iCh, chanelid, ampl, corType);
if (corType == kFT0C) {
if ((cfgRejectFT0CInside && (chanelid >= kFT0CInnerRingMin && chanelid <= kFT0CInnerRingMax)) || (cfgRejectFT0COutside && (chanelid >= kFT0COuterRingMin && chanelid <= kFT0COuterRingMax))) {
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable name chanelid looks like a typo and makes the new rejection logic harder to read/grep. Consider renaming to channelId (and adjusting related uses) for clarity.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant